package com.andia.app.browser;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.swt.widgets.Shell;

public class OpenMenuBar {

	private Shell shell;

	private Menu bar;

	MenuBarFile barFile;

	MenuBarView barView;

	MenuBarGo barGo;

	MenuBarHelp barHelp;

	public OpenMenuBar(Shell shell) {
		this.shell = shell;
		bar = new Menu(shell, SWT.BAR);
	}

	void createMenuBarMain() {
		shell.setMenuBar(bar);

		// Menu Item File
		barFile = new MenuBarFile(shell);
		MenuItem fileItem = new MenuItem(bar, SWT.CASCADE);
		fileItem.setText("File");
		fileItem.setMenu(barFile.createMenuItem());

		// Menu Item View
		barView = new MenuBarView(shell);
		MenuItem viewItem = new MenuItem(bar, SWT.CASCADE);
		viewItem.setText("View");
		viewItem.setMenu(barView.createMenuItem());

		// Menu Item Go
		barGo = new MenuBarGo(shell);
		MenuItem goItem = new MenuItem(bar, SWT.CASCADE);
		goItem.setText("Go");

		// Menu Item Help
		barHelp = new MenuBarHelp(shell);
		MenuItem helpItem = new MenuItem(bar, SWT.CASCADE);
		helpItem.setText("Help");

	}
}
